#ifndef KEYBOARD_HH_
# define KEYBOARD_HH_

# include <SDL/SDL.h>
# include <GL/glew.h>

# include <map>
# include <fstream>
# include <string>
# include <cassert>
# include <list>

# include "../gui/text-img.hh"
# include "mouse.hh"

# include "../camera/camera_rts.hh"
# include "../camera/camera_fps.hh"

# include "../action/action_queue.hh"

typedef std::map<SDLKey, std::string> KeyConf;
typedef std::map<std::string, Action*> ActionConf;

class Keyboard
{
public:
  Keyboard (bool* go, Camera* cam, Mouse* m);
  ~Keyboard ();

  void event (float elapsed_time);
  void switch_chat (SDLKey key);
  void enable_chat_switch (SDLKey key);
  void handle_chat (const SDL_Event& e);
  void do_actions ();

  void init_actions ();

  // chat methods
  void chat_active_switch () { chat_active_ = !chat_active_; }
  void chat_enable_switch () { chat_enable_ = !chat_enable_; }

  // setter for the mouse
  void mouse (Mouse* m) { m_ = m; }

protected:
  void parse_file ();

  Uint8* keystate_;
  SDL_Event e_;
  bool* go_;
  Camera* cam_;
  Mouse* m_;

  KeyConf keyconf_RTS_;
  KeyConf keyconf_FPS_;
  ActionConf act_RTS_;
  ActionConf act_FPS_;

  bool mode_FPS;

  // chat bools
  bool chat_active_;
  bool chat_enable_;

  std::queue<Action*>* queue_;
  bool* clicked_;
};

#endif /// !KEYBOARD_HH_
